package {
	import cn.flashk.CustomTreeRender;
	import cn.flashk.controls.Accordion;
	import cn.flashk.controls.Alert;
	import cn.flashk.controls.Button;
	import cn.flashk.controls.CheckBox;
	import cn.flashk.controls.ComboBox;
	import cn.flashk.controls.DataGrid;
	import cn.flashk.controls.Image;
	import cn.flashk.controls.Label;
	import cn.flashk.controls.LinkText;
	import cn.flashk.controls.List;
	import cn.flashk.controls.NumericStepper;
	import cn.flashk.controls.Panel;
	import cn.flashk.controls.ProgressBar;
	import cn.flashk.controls.RadioButton;
	import cn.flashk.controls.Slider;
	import cn.flashk.controls.TabBar;
	import cn.flashk.controls.TabNav;
	import cn.flashk.controls.Text;
	import cn.flashk.controls.TextArea;
	import cn.flashk.controls.TextInput;
	import cn.flashk.controls.TileList;
	import cn.flashk.controls.Tree;
	import cn.flashk.controls.VScrollBar;
	import cn.flashk.controls.Window;
	import cn.flashk.controls.data.CustomListIVo;
	import cn.flashk.controls.data.DataProvider;
	import cn.flashk.controls.data.ListItem;
	import cn.flashk.controls.events.ListEvent;
	import cn.flashk.controls.managers.SkinLoader;
	import cn.flashk.controls.managers.SkinManager;
	import cn.flashk.controls.managers.SkinThemeColor;
	import cn.flashk.controls.modeStyles.ButtonStyle;
	import cn.flashk.controls.support.DataGridColumnSet;
	import cn.flashk.ui.UI;
	
	import com._public._net.LoadData;
	import com.flashdynamix.utils.Util;
	import com.skins.MkConfig;
	
	import flash.display.BitmapData;
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.utils.getTimer;

	[SWF(frameRate="30",width="1000",height="500",backgroundColor="0xffffff")]
	public class FlashkUI extends Sprite {
		private var _tileList:TileList;
		private var _list:List;
		private var _treeData:XML;
		private var _count:int = 0;
		private var _colorCount:int = -1;
		private var _color2Count:int = -1;
		private var _tabs:TabBar;
		private var _tab1SP:Sprite;
		private var _tab2SP:Sprite;
		private var _tab3SP:Sprite;
		private var _tab4SP:Sprite;
		private var _tab5SP:Sprite;
		private var _inputColor:TextInput;
		private var _inputRatios:TextInput;
		private var _inputAlpha:TextInput;
		private var _numAngle:NumericStepper;
		private var _checkAuto:CheckBox;
		private var _colors2:ComboBox;
		private var _bu:Button;
		private var _tree:Tree;
		private var _xml:XML;
		private var _label:Label;
		private var _label2:Label;
		private var _combo:ComboBox;
		private var _bd:BitmapData;
		private var _pro1:ProgressBar;
		private var _pro2:ProgressBar;
		private var _pro3:ProgressBar;
		private var _pro4:ProgressBar;
		private var _pro5:ProgressBar;
		private var _pro6:ProgressBar;
		private var _fpsCombo:ComboBox;
		private var _pcount:int = 0;

		public function FlashkUI(){
			stage.scaleMode = StageScaleMode.NO_SCALE;
			stage.align = StageAlign.TOP_LEFT;
			//SWFProfiler.init(stage,this);
			UI.init(this.stage);
			this.x = this.y = 5;
			_bd = new BitmapData(14, 14, true, 0x00FFFFFF);
			_bd.setPixel32(5, 5, 0xFF000000);
			_bd.setPixel32(7, 7, 0xFF000000);
			_bd.setPixel32(5, 7, 0xFF000000);
			_bd.setPixel32(5, 9, 0xFF000000);
			_bd.setPixel32(12, 5, 0xFFFF6600);
			_bd.setPixel32(12, 7, 0xFF00FF00);
			_bd.setPixel32(10, 7, 0xFF0000FF);
			_bd.setPixel32(12, 9, 0xFF000000);
			
			SkinThemeColor.userDefaultColor(7);
			initUI();
			//SkinLoader.loadSkinFile("skin/assert/skin.swf");
			//SkinLoader.eventDispatcher.addEventListener(SkinLoader.SKIN_LOADED,startBtn)
			//startBtn();
		}

		protected function startBtn(event:Event = null):void {
			LoadData.getInstance().loadXML("skin/style.xml", handler0);
		}

		private function handler0(val:XML):void {
			SkinLoader.setSkinStyle(val);
			MkConfig.getInstance().skinConfig = "skin/skinConfig.xml"
			MkConfig.getInstance().addEventListener(Event.COMPLETE, initUI);
		}

		public function initUI(e:Event = null):void {
			var t:int;
			_tab1SP = new Sprite();
			_tab2SP = new Sprite();
			_tab3SP = new Sprite();
			_tab4SP = new Sprite();
			_tab5SP = new Sprite();
			_tabs = new TabBar();
			_tabs.setSize(845, 450);
			_tabs.x = 130;
			this.addChild(_tabs);
			_tabs.addTab("基础组件", _tab1SP);
			_tabs.addTab("进度条", _tab2SP);
			_tabs.addTab("框", _tab3SP);
			_tabs.addTab("列表", _tab4SP);
			_tabs.addTab("数列表、树", _tab5SP);
			_tab1SP.x = _tab1SP.y = 10;
			_tab2SP.x = _tab2SP.y = 10;
			_tab3SP.x = _tab3SP.y = 10;
			
			buttonHandler();
			progressHandler();
			panelHandler();
			listHandler();
			treeHandler();
			
			initSetSkin();
		}

		/**修改皮肤*/
		private function onModifeClick(event:MouseEvent):void {
			if(!SkinManager.isUseDefaultSkin)return;
			SkinThemeColor.fillColors = getColorArrs(_inputColor.text);
			SkinThemeColor.fillRatios = getNumberArr(_inputRatios.text);
			SkinThemeColor.fillAlphas = getNumberArr(_inputAlpha.text);
			SkinThemeColor.fillAngle = _numAngle.value;
			
			var a:Class = SkinThemeColor;
			SkinManager.updateAllComponentsSkin();
		}
		
		/**
		 * 主题设置
		 */
		private function initSetSkin():void {
			UI.creatButton("修改皮肤", this, onModifeClick, 10, 0); 
			
			UI.creatButton("下一个主题", this, onNextClick, 10,40, 110, 23);
			_colors2 = new ComboBox();
			_colors2.setSize(110, _colors2.compoHeight);
			var i:int;
			var item:ListItem;
			for (i = -1; i < 80; i++){
				item = new ListItem();
				if (i == -1){
					item.label = "选择一个主题";
					item.value = -1;
				} else {
					item.label = "主题" + i;
					item.value = i;
					if (i == 79)
						item.value = 80;
				}
				_colors2.addItem(item);
			}
			_colors2.moveTo(10, 80);
			_colors2.rowCount = 15;
			_colors2.addEventListener(Event.CHANGE, changeColor2);
			this.addChild(_colors2);
			
			_fpsCombo = new ComboBox();
			item = new ListItem(); //项
			item.label = "30FPS";
			item.value = 30;
			_fpsCombo.addItem(item);
			item = new ListItem();
			item.label = "45FPS";
			item.value = 45;
			_fpsCombo.addItem(item);
			item = new ListItem();
			item.label = "60FPS";
			item.value = 60;
			_fpsCombo.addItem(item);
			_fpsCombo.moveTo(10, 120);
			_fpsCombo.setSize(110, _fpsCombo.compoHeight);
			this.addChild(_fpsCombo);
			_fpsCombo.addEventListener(Event.CHANGE, onFPSChange);
			
			var label:Label = new Label();
			label.text = "主题颜色";
			label.moveTo(0,_fpsCombo.height +_fpsCombo.y + 40);
			this.addChild(label);
			_inputColor = new TextInput();
			_inputColor.tipText = "请输入颜色值"
			_inputColor.moveTo(0, label.y + label.height + 8);
			this.addChild(_inputColor);
			_inputRatios = new TextInput();
			_inputRatios.moveTo(0, _inputColor.y + _inputColor.height + 8);
			this.addChild(_inputRatios);
			
			_inputAlpha = new TextInput();
			_inputAlpha.moveTo(0, _inputRatios.y + _inputRatios.height + 8);
			this.addChild(_inputAlpha);
			
			_checkAuto = new CheckBox();
			_checkAuto.label = "自动替换当前样式";
			_checkAuto.selected = true;
			this.addChild(_checkAuto);
			_checkAuto.moveTo(0,_inputAlpha.y + _inputAlpha.height + 10);
			
			_numAngle = new NumericStepper();
			_numAngle.moveTo(0,_checkAuto.y + _checkAuto.height + 10);
			_numAngle.minimum = -360;
			this.addChild(_numAngle);
		}
		
		protected function buttonHandler():void {
			_bu = new Button();
			_bu.x = 10;
			_bu.label = "确定";
			_bu.enabled = false;
			_tab1SP.addChild(_bu);
			_bu = new Button();
			_bu.x = 10;
			_bu.y = 30;
			_bu.label = "确定";
			_bu.setStyle(ButtonStyle.DEFAULT_SKIN_ELLIPSE_WIDTH, 7);
			_bu.setStyle(ButtonStyle.DEFAULT_SKIN_ELLIPSE_HEIGHT, 7);
			_tab1SP.addChild(_bu);
			_bu = new Button();
			_bu.x = 10;
			_bu.y = 60;
			_bu.icon = _bd;
			_tab1SP.addChild(_bu);
			_bu.setStyle(ButtonStyle.DEFAULT_SKIN_ELLIPSE_WIDTH, 3.5);
			_bu.setStyle(ButtonStyle.DEFAULT_SKIN_ELLIPSE_HEIGHT, 3.5);
			var radion:RadioButton;
			radion = new RadioButton();
			radion.label = "选项1";
			radion.moveTo(120, 0);
			_tab1SP.addChild(radion);
			radion = new RadioButton();
			radion.label = "选项2";
			radion.moveTo(120, 30);
			_tab1SP.addChild(radion);
			var checkBox:CheckBox;
			checkBox = new CheckBox();
			checkBox.label = "勾选1";
			checkBox.moveTo(120, 60);
			_tab1SP.addChild(checkBox);
			checkBox = new CheckBox();
			checkBox.label = "勾选2";
			checkBox.moveTo(120, 90);
			_tab1SP.addChild(checkBox);
			
			var input:TextInput = new TextInput();
			input.tipText = "请输入内容"
			input.moveTo(0, 160);
			_tab1SP.addChild(input);
			trace(input.height)
			
			input = new TextInput();
			_tab1SP.addChild(input);
			input.moveTo(0,196);
			trace(input.height)
			
			var label:Label = new Label()
			label.text = "Label";
			_tab1SP.addChild(label);
			label.moveTo(checkBox.x + checkBox.width +40,0);
			
			var link:LinkText = new LinkText();
			_tab1SP.addChild(link);
			link.moveTo(checkBox.x + checkBox.width +40,label.y + label.height + 10);
			link.label = "link";
			
			var text:Text = new Text();
			text.text = "多行文本";
			_tab1SP.addChild(text);
			text.moveTo(checkBox.x + checkBox.width +40,link.y + link.height + 10);
			var area:TextArea = new TextArea();
			area.text = "滚动文本";
			_tab1SP.addChild(area);
			area.moveTo(checkBox.x + checkBox.width +40,text.y + text.height + 10);
			area.setSize(164,124);
			
			var img:Image = new Image();
			img.source = "skin/assert/alpha.png";
			_tab1SP.addChild(img);
			img.moveTo(area.x + area.width + 30,0);
		}

		protected function progressHandler():void {
			_pro1 = new ProgressBar("progress");
			_pro1.setSize(238,21);
			_pro2 = new ProgressBar();
			_pro2.y = 50;
			_pro2.showText = "请稍候。。。";
			_pro3 = new ProgressBar();
			_pro3.toFixNum = 0;
			_pro3.y = 100;
			_pro3.showText = "*% 图片下载中。。。";
			_pro4 = new ProgressBar();
			_pro4.y = 150;
			_pro4.setStyle("ellipse", 0);
			_pro5 = new ProgressBar();
			_pro5.y = 200;
			_pro5.toFixNum = 2;
			_pro5.setStyle("ellipse", 0);
			_pro5.setStyle("motionAngle", 90);
			_pro5.setStyle("motionWidth", 6);
			_pro5.setStyle("motionSpace", 3);
			_pro6 = new ProgressBar();
			_pro6.y = 250;
			_pro6.showText = "正在处理音频数据";
			_pro6.setStyle("motionAngle", -30);
			_tab2SP.addChild(_pro1);
			_tab2SP.addChild(_pro2);
			_tab2SP.addChild(_pro3);
			_tab2SP.addChild(_pro4);
			_tab2SP.addChild(_pro5);
			_tab2SP.addChild(_pro6);
			this.addEventListener(Event.ENTER_FRAME, updateProgress);
			
			var slider:Slider = new Slider("slider");
			slider.x = 320;
			slider.y = 40;
			slider.snapInterval = 1;
			slider.minSpaceNum = 5;
			slider.thumbCount = 2;
			_tab2SP.addChild(slider);
			
			slider = new Slider();
			slider.x = 320;
			slider.y = 100;
			slider.snapInterval = 10;
			slider.minSpaceNum = 10;
			_tab2SP.addChild(slider);
			slider = new Slider();
			slider.x = 320;
			slider.y = 140;
			slider.snapInterval = 1;
			slider.minSpaceNum = 5;
			_tab2SP.addChild(slider);
		}
		/**
		 * 进度条数据
		 * @param event
		 */		
		protected function updateProgress(event:Event):void {
			_pcount++;
			_pro1.value = _pcount / 1000;
			_pro3.value = _pcount / 1000;
			_pro4.value = _pcount / 1000;
			_pro5.value = _pcount / 1000;
			if (_pcount > 1050){
				_pcount = 0;
			}
			if(_pro1.value == 1){
				this.removeEventListener(Event.ENTER_FRAME, updateProgress);
			}
		}

		protected function panelHandler():void {
			var acc:Accordion = new Accordion();
			acc.setSize(214,186);
			acc.add("选项一",new Sprite(),_bd)
			acc.add("选项二",new Sprite(),_bd)
			acc.add("选项三",new Sprite(),_bd);
			_tab3SP.addChild(acc);
			
			//竖型滚动条
			var bg:Sprite = new Sprite();
			bg.graphics.beginFill(0xff0000,.2);
			bg.graphics.drawRect(0,0,90,650);
			bg.x = acc.x + acc.width +30;
			bg.graphics.endFill();
			_tab3SP.addChild(bg);
			var vscrollBar:VScrollBar = new VScrollBar();
			_tab3SP.addChild(vscrollBar);
			vscrollBar.setTarget(bg,true,90,180);
			vscrollBar.updateSize(bg.height - 2);
			vscrollBar.moveTo(acc.width + acc.y + 120,0);
			vscrollBar.height = 180;
			
			var tabnav:TabNav = new TabNav("tabnav");
			tabnav.setSize(240,180);
			var sp1:Sprite= new Sprite();
			var sp2:Sprite= new Sprite();
			var sp3:Sprite= new Sprite();
			tabnav.addTab("选项一",sp1);
			tabnav.addTab("选项二",sp2);
			tabnav.addTab("选项三",sp3);
			tabnav.moveTo(vscrollBar.x + vscrollBar.width + 20,vscrollBar.y);
			_tab3SP.addChild(tabnav);
			var lab1:Label = new Label();
			lab1.text = "选项一";
			sp1.addChild(lab1);
			var lab2:Label = new Label();
			lab2.text = "选项二";
			sp2.addChild(lab2);
			var lab3:Label = new Label();
			lab3.text = "选项三";
			sp3.addChild(lab3);
			
			var btn:Button = UI.creatButton("panel",this);
			var panel:Panel = new Panel();
			panel.title = "panel"
			panel.moveTo(0,acc.y + acc.height + 20);
			panel.content = btn;
			_tab3SP.addChild(panel);
			
			var win:Window = new Window("window");
			_tab3SP.addChild(win);
			win.moveTo(panel.x + panel.width + 20,panel.y);
		}
		
		/**
		 * 列表组件 
		 */		
		protected function listHandler():void {
			var dp:DataProvider = new DataProvider([1,2,3,4,5,6,7,8,9,10]);
			var combox:ComboBox = new ComboBox();//"comboBox"
			//combox.editable = true;
			combox.dataProvider = dp;
			combox.moveTo(1,0);
			_tab4SP.addChild(combox);
			
			var combo:ComboBox = new ComboBox();
			var item:CustomListIVo;
			for (var i:int = 1; i < 10; i++){
				item = new CustomListIVo();
				item.label = "数据" + i;
				combo.addItem(item);
			}
			combo.y = 60;
			_tab4SP.addChild(combo);
			
			_tileList = new TileList();
			_tileList.setSize(360, 228);
			for (i = 1; i < 51; i++){
				item = new CustomListIVo()
				item.label = "文件" + i;
				//item.source = _bd;
				item.source= "skin/assert/alpha.png";
				_tileList.addItem(item)
			}
			_list = new List();
			_list.snapNum = 2;
			_list.x = 380;
			_list.setSize(150, 228);
			var t:int = getTimer();
			for (i = 1; i < 101; i++){
				item = new CustomListIVo()
				item.label = "内容" + i;
				item.icon = _bd;
				_list.addItem(item)
			}
			trace("时间:" + (getTimer() - t));
			_tileList.y = _list.y = 180;
			_tab4SP.addChild(_tileList);
			_tab4SP.addChild(_list);
			
			
			var nums:NumericStepper = new NumericStepper();
			nums.minimum = -100;
			nums.y = 110;
			_tab4SP.addChild(nums);
			
			nums = new NumericStepper();
			nums.y = 140;
			nums.value = 15;
			nums.enabled = false;
			_tab4SP.addChild(nums);
			
			var deleteNum2:NumericStepper = new NumericStepper();
			deleteNum2.value = -95;
			deleteNum2.minimum = -100;
			deleteNum2.moveTo(nums.x + nums.width + 10, 140);
			_tab4SP.addChild(deleteNum2);
		}
		protected function treeHandler():void {
			//initSetSkin();
			
			_tree = new Tree();
			_tree.itemDoubleClickEnabled = true;
			_tree.addEventListener(ListEvent.ITEM_DOUBLE_CLICK, onDoubleClick);
			_tree.addEventListener(ListEvent.ITEM_CLICK, onItemClick);
			_tree.itemRender = CustomTreeRender;
			//_tree.itemRender = BaseTreeItemRender;
			_tree.isParentAutoClickOpen = true;
			_tree.setSize(240, 198);
			_xml = 
				<data>
					<item label="房间" id="1">
						<item label="女" id="1">
							<item label="aaa1"  id="51"/>
							<item label="aaa2"  id="51"/>
							<item label="aaa3"  id="51"/>
							<item label="aaa4"  id="51"/>
						</item>
						<item label="男" id="1">
							<item label="bbb1"  id="51"/>
							<item label="bbb2"  id="51"/>
							<item label="bbb3"  id="51"/>
							<item label="bbb4"  id="51"/>
							<item label="bbb5"  id="51"/>
							<item label="bbb6"  id="51"/>
						</item>
					</item>
					<item label="我的好友" id="1">
						<item label="玩家a"  id="51"/>
					</item>
					<item label="陌生人" id="1">
						<item label="玩家b"  id="51"/>
					</item>
					<item label="黑名单" id="1">
						<item label="玩家c"  id="51"/>
					</item>
				</data>;

			_tab5SP.addChild(_tree);
			_tree.dataProvider = _xml;
			var btn:Button;
			btn = new Button();
			btn.label = "成批插入";
			btn.x = 350;
			btn.addEventListener(MouseEvent.CLICK, onBtnClickF);
			_tab5SP.addChild(btn);
			UI.creatButton("全部展开", _tab5SP, openAll, 350, 30);
			UI.creatButton("全部收起", _tab5SP, closeAll, 350, 60);
			UI.creatButton("碎片插入", _tab5SP, onBtnClick3, 350, 90);
			UI.creatButton("删除单个", _tab5SP, onBtnClickDel, 350, 120);
			_label2 = new Label();
			_label2.x = 400;
			_label2.y = 400;
			_tab5SP.addChild(_label2);
			_combo = new ComboBox();
			_combo.addItem({label: 1, value: 1});
			_combo.addItem({label: 10, value: 10});
			_combo.addItem({label: 50, value: 50});
			_combo.addItem({label: 100, value: 100});
			_combo.addItem({label: 300, value: 300});
			_combo.addItem({label: 500, value: 500});
			_combo.addItem({label: 1000, value: 1000});
			_tab5SP.addChild(_combo);
			_combo.x = 500;
			_combo.selectedIndex = 2;
			
			
			var dg:DataGrid = new DataGrid();
			dg.setSize(480,182);
			_tab5SP.addChild(dg);
			dg.moveTo(0,_tree.y + _tree.height + 20);
			dg.labels = ["ID","状态","时间","值","对象"];
			dg.dataField = ["id","type","time","value"];
			for(var i:int=0;i<18;i++) {
				var obj:Object = {};
				obj.id = i+1;
				obj.type = "type"+i;
				obj.value = "value";
				obj.time = Util.getSysDate(new Date().getTime());
				dg.addItem(obj);
			}
		}

		private function onNextClick(event:Event):void {
			if(!SkinManager.isUseDefaultSkin) return;
			if (_colors2.selectedIndex < _colors2.dropdown.length - 1){
				_colors2.selectedIndex = _colors2.selectedIndex + 1;
			} else {
				_colors2.selectedIndex = 0;
			}
			changeColor2(event);
		}

		/**
		 * 更改帧频 
		 * @param event
		 * 
		 */		
		protected function onFPSChange(event:Event):void {
			this.stage.frameRate = _fpsCombo.selectedItem.value;
		}

		/**
		 * 更改主题 
		 * @param event
		 * 
		 */		
		protected function changeColor2(event:Event):void {
			if(!SkinManager.isUseDefaultSkin) return;
			if (_colors2.selectedItem.value == -1)
				return;
			SkinManager.changeActionSkin(_colors2.selectedItem.value);
			updteSet();
		}

		private function getColorArrs(str:String):Array {
			var arr:Array;
			arr = _inputColor.text.split(",");
			var i:int;
			for (i = 0; i < arr.length; i++){
				arr[i] = uint("0x" + String(arr[i]).slice(1));
			}
			return arr;
		}

		private function getNumberArr(str:String):Array {
			var arr:Array;
			arr = str.split(",");
			var i:int;
			for (i = 0; i < arr.length; i++){
				arr[i] = Number(arr[i]);
			}
			return arr;
		}

		private function updteSet():void {
			if (_checkAuto.selected == true){
				var i:int;
				var str:String;
				str = "";
				for (i = 0; i < SkinThemeColor.fillColors.length; i++){
					str += ",#" + uint(SkinThemeColor.fillColors[i]).toString(16);
				}
				str = str.toUpperCase();
				_inputColor.text = str.slice(1);
				_inputRatios.text = SkinThemeColor.fillRatios.join(",");
				_inputAlpha.text = SkinThemeColor.fillAlphas.join(",");
				_numAngle.value = SkinThemeColor.fillAngle;
			}
		}

		/**
		 * 点击树弹出内容 
		 * @param event
		 * 
		 */		
		protected function onDoubleClick(event:ListEvent):void {
			Alert.show("用户双击项目：" + event.targetItem.data.@label);
		}

		protected function onItemClick(event:ListEvent):void {
			_label2.text = "用户单击项目：" + event.targetItem.data.@label;
		}

		private function onBtnClickDel(event:MouseEvent):void {
			var t:int = getTimer();
			_tree.removeOneItem(_xml.item[0].item[0].item[0]);
			delete _xml.item[0].item[0].item[0];
			if (_xml.item[0].item[0].children().length() == 0){
				trace("update************");
				_tree.updateWholeTreeNow();
			}
			trace("--", getTimer() - t);
		}

		private function openAll(event:MouseEvent):void {
			var t:int = getTimer();
			_tree.expandChildrenOf(null, true);
			trace("zk:", getTimer() - t);
		}

		private function closeAll(event:MouseEvent):void {
			_tree.expandChildrenOf(null, false);
		}

		protected function onBtnClickF(event:MouseEvent):void {
			if (_xml.item[0].item[0].children().length() == 0){
				var needUpdate:Boolean = true;
			}
			for (var i:int = 1; i < _combo.selectedItem.value + 1; i++){
				_count++;
				var node:XML =
					<item label="玩家"  id="0"/>
				node.@label = "玩家" + _count;
				_tree.addItemChildIn(node, _xml.item[0].item[0], false);
			}
		}

		protected function onBtnClick3(event:MouseEvent):void {
			for (var i:int = 1; i < _combo.selectedItem.value + 1; i++){
				_count++;
				var node:XML =
					<item label="玩家"  id="51"/>

				node.@label = "玩家" + _count;
				_tree.addItemChildIn(node, _xml.item[0].item[0]);
			}
		}

		private function changeWin8(event:MouseEvent):void {
			SkinManager.changeActionSkin(80);
			updteSet();
		}

		private function listTest(event:MouseEvent):void {
			var i:int = 0;
			var item:CustomListIVo;
			_list.removeAll();
			for (i = 1; i < 1001; i++){
				_count++;
				item = new CustomListIVo()
				item.label = "内容" + _count;
				_list.addItem(item)
			}
		}

		private function datagrid():void {
			var dg:DataGrid = new DataGrid();
			dg.setSize(917, 500);
			dg.allowMultipleSelection = true;
			var sets:Vector.<DataGridColumnSet> = new Vector.<DataGridColumnSet>();
			sets.push(new DataGridColumnSet("序", "label1", 50));
			sets.push(new DataGridColumnSet("玩家a", "label2", 100));
			sets.push(new DataGridColumnSet("玩家b", "label3", 100));
			sets.push(new DataGridColumnSet("玩家c", "label4", 100));
			sets.push(new DataGridColumnSet("玩家d", "label5", 100));
			sets.push(new DataGridColumnSet("玩家e", "label6", 100));
			sets.push(new DataGridColumnSet("玩家f", "label7", 100));
			sets.push(new DataGridColumnSet("玩家", "label8", 100));
			sets.push(new DataGridColumnSet("玩家", "label9", 100));
			sets.push(new DataGridColumnSet("玩家", "label10", 30));
			dg.initColumns(sets);
			for (var i:int = 0; i < 10; i++){
				var item:Object = {};
				item.label1 = i + 1;
				item.label2 = "a" + i;
				item.label3 = "b" + i;
				item.label4 = "c" + i;
				item.label5 = "d" + i;
				item.label6 = "e" + i;
				item.label7 = "f" + i;
				item.label8 = "中文g" + i;
				item.label9 = "h" + i;
				item.label10 = "i" + i;
				dg.addItem(item);
			}
			this.addChild(dg);
		}

		protected function onBtnClick(event:MouseEvent):void {
			_colorCount++;
			_colorCount = _colorCount % 71;
			SkinManager.changeActionSkin(_colorCount);
			updteSet();
		}

		protected function onBtnClick2(event:MouseEvent):void {
			_color2Count++;
			_color2Count = _color2Count % 71;
			SkinManager.changeActionSkin(_color2Count + 100);
			updteSet();
		}
	}
}